/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package fr.p10.miage.gestionabsence.model;

import java.io.File;
import java.io.IOException;
import javax.servlet.http.HttpServletRequest;

import jxl.Cell;
import jxl.Sheet;
import jxl.Workbook;

import jxl.read.biff.BiffException;

import jxl.write.*;

/**
 *
 * @author seidso
 */
public class ExcelCreator {

   public static void create(HttpServletRequest request) throws BiffException, IOException, WriteException {
      String f=  request.getServletContext().getRealPath("presence.xls");
      String n=  request.getServletContext().getRealPath("output.xls");
      Workbook workbook = Workbook.getWorkbook(new File(f)); 
      WritableWorkbook copy = Workbook.createWorkbook(new File(n), workbook); 
      copy.write();
      copy.close();
      workbook.close(); 
    }
}
